export const orderAttrsMap = {
  OrderId: "订单编号",
  OrderId2: "工单编号",
  Color: "颜色",
  CompanyName: "公司名称",
  CustomerName: "客户",
  Province: "省份",
  City: "城市",
  Area: "县/区",
  CreateTime: "创建时间",
  AuditTime: "技术审核",
  OrderAudit: "订单审核",
  ProduceTime: "生产下单",
  Indate: "入库日期",
  DeliveryEffectTime: "发货单生效",
  OutDate: "出库日期",
  DeliveryTime: "交货日期",
  Status: "状态",
  ProductName: "产品名称",
  PartnerBrand: "代理品牌",
  CountAttrs: "属性数量",
  Deleted: "是否删除",
  DoorLeafBarCode: "门叶柱编号",
  DoorLeafSize: "门叶尺寸",
  DoorPocketBarCode: "口袋门柱编号",
  DoorPocketRequire: "口袋门需求",
  DoorPocketSize: "口袋门尺寸",
  DoorPocketType: "口袋门类型",
  DoorwaySize: "门道尺寸",
  FinishTime: "完成时间",
  GateType: "门类型",
  InputRemark: "用户输入备注",
  IsCancelOver: "是否取消",
  IsFinish: "是否已完成",
  OrderTime: "定货日期",
  IsOrderOverTime: "订单是否超时",
  IsOverTime: "是否超时",
  IsReturn: "是否交还",
  IsShow: "是否展示",
  LatestTrackInfo: "最新工序信息",
  LeafCount: "门叶数量",
  LineCount: "门线数量",
  LineType: "门线类型",
  Mark: "标记",
  MaterialQuality: "材料质量",
  Mobile: "风铃",
  NonTrackList: "无工序列表",
  OMarkDescription: "标记描述",
  OMarkStatus: "标记状态",
  OMarkStatusName: "标记状态名",
  OrderClerkName: "订单接单人",
  OrderRemark: "订单备注",
  OrderTime: "接单时间",
  OverTimeName: "超时名称",
  PieceCount: "碎片数量",
  PocketCount: "门袋数量",
  ProduceCode: "生产编号",
  ProcessName: "工艺名称",
  QuantityUnit: "质量单位",
  Remark: "备注",
  RemarkView: "动态备注",
  SalesmanName: "订单销售员",
  SamplePicture: "订单缩略图",
  Picture: "附图",
  Status: "订单状态",
  StatusName: "状态名称",
  SubCustomerName: "子客户名称",
  Technique: "技术",
  TotalDays: "总用时（天）",
  TrackList: "工序进度",
  Type: "系列",
  Urgent: "是否加急",
  Veneer: "胶合板",
  WallThickness: "墙体厚度",
  LaceName: "花边名称",
  DoorStyle: "门面款式",
  CountLeft: '数量-左',
  CountRight: '数量-右',
  MainExStyle: "主外款式",
  MainInStyle: "主内款式",
  SecExStyle: "副外款式",
  SecInStyle: "副内款式",
  ChildExStyle: "子外款式",
  ChildInStyle: "子内款式",
  SideExStyle: "边外款式",
  SideInStyle: "边内款式",
  FacadeExGlass: "门面外玻",
  FacadeGlass: '门面玻璃',
  FacadeInGlass: "门面内玻",
  OutdoorColor: "室外颜色",
  IndoorColor: "室内颜色",
  FrameColor: "门框颜色",
  FacadeMaterial: "门面材料",
  ExFacadeMaterial: "外门面材料",
  InFacadeMaterial: "内门面材料",
  FrameMaterial: "门框材料",
  LockName: "锁具名称",
  ExGlassAirWin: "气窗外玻",
  InGlassAirWin: "气窗内玻",
  LowerLevelMaterial: "下档材料",
  LowerLevelType: "下档类型",
  LowerLevelHeight: "下档高度",
  DoorHeader: "门头",
  DoorPost: "门柱",
  DoorHeaderInstallPos: "门头安装位置",
  PinName: "插销名称",
  HingeName: "铰链名称",
  attrName58: "铰链个数",
  HingeNum: "门头备注",
  Count: "下单数量",
  UnitPrice: "单价",
  Square: "平方",
  PayMethod: "结算方式",
  LockAmount: "锁具金额",
  LockCoreAmount: "锁芯金额",
  LaceAmount: "花边金额",
  WallAmount: "墙体金额",
  GlassAmount: "玻璃金额",
  PackageAmount: "包装金额",
  OtherAmount: "其他金额",
  HandleAmount: "拉手金额",
  DoorHeaderAmount: "门头金额",
  Discount: "折扣",
  SettlementAmount: "结算金额",
  TotalAmount: "总金额",
  OrderTaker: "接单员",
  Salesman: "业务员",
  InDoorRemark: "内门备注",
  nField: "自定义属性",
  Field1: "门型",
  Field2: "颜色",
  Field3: "开向",
  Field4: "门总高",
  Field5: "门总宽",
  Field6: "门高",
  Field7: "子客户",
  Field8: "包边名称",
  Field9: "拉手名称",
  Field10: "墙体厚度",
  Field11: "气窗工艺",
  Field12: "气窗款式",
  Field13: "工艺厚度",
  Field14: "要求一",
  Field15: "要求二",
  Square: "平方",
  OrderMoney: "金额",
  PriceDesc: "价格说明",

  // Field1 - Field15 额外加上键名以便区分Map
  // 门型: "doorShape",
  // 颜色: "doorColor",
  // 开向: "doorOpenAt",
  // 门总高: "doorTotalHeight",
  // 门总宽: "doorTotalWidth",
  // 门高: "doorHeight",
  // 子客户: "doorSubCustomer",
  // 包边: "doorCasing",
  // 拉手: "doorHandle",
  // 墙厚: "doorWallThickness",
  // 气窗工艺: "doorVentilationProduce",
  // 气窗款式: "doorVventilationStyle",
  // 工艺厚度: "doorProduceThickness",
  // 要求一: "doorDemand1",
  // 要求二: "doorDemand2",
};
export const orderAttrsMap2 = {
  SubCustomerName: "子客户名称",
  Tickness_Leaf: "工艺厚度",
  GateType: "工艺名称",
  Height_Total: "门总高",
  Width_Total: "门总宽",
  Height_Leaf: "门高",
  Tickness_Wall: "墙体厚度",
  Direction: "开向",
  Border: "包边名称",
  Lace: "花边名称",
  Count1: "数量-左",
  Count2: "数量-右",
  Count: "数量",
  Type: "门面款式",
  Type_MainOutside: "主外款式",
  Type_MainInside: "主内款式",
  Type_DeputyOutside: "副外款式",
  Type_DeputyInside: "副内款式",
  Type_SubOutside: "子外款式",
  Type_SubInside: "子内款式",
  Type_SideOutside: "边外款式",
  Type_SideInside: "边内款式",
  Glass: "玻璃",
  Glass_LeafOutside: "门面外玻",
  Glass_LeafInside: "门面内玻",
  Glass_TransomOutside: "气窗外玻",
  Glass_TransomInside: "气窗内玻",
  Transom: "气窗款式",
  Technology_Transom: "气窗工艺",
  Color: "颜色",
  Color_Outside: "室外颜色",
  Color_Inside: "室内颜色",
  Color_Pocket: "门框颜色",
  Material_Pocket: "门框材料",
  Material_Leaf: "门面材料",
  Material_LeafOutside: "外门面材料",
  Material_LeafInside: "内门面材料",
  LockSet: "锁具名称",
  DoorHandle: "拉手名称",
  Material_Threshold: "下档材料",
  Threshold: "下档类型",
  Height_Threshold: "下档高度",
  DoorHeader: "门头",
  DoorPost: "门柱",
  Position_DoorHeader: "门头安装位置",
  Remark_DoorHeader: "门头备注",
  Plug: "插销名称",
  Hinge: "铰链名称",
  Count_Hinge: "铰链个数",
  Price: "单价",
  Square: "平方",
  Settlement: "结算方式",
  Money_LockSet: "锁具金额",
  Money_LockCylinder: "锁芯金额",
  Money_Lace: "花边金额",
  Money_Wall: "墙体金额",
  Money_Glass: "玻璃金额",
  Money_Package: "包装金额",
  Money_Other: "其他金额",
  Money_DoorHandle: "拉手金额",
  Money__DoorHeader: "门头金额",
  Discount: "折扣",
  Money_Settlement: "结算金额",
  Money_Total: "总金额",
  Remark: "备注",
  OrderClerkName: "接单员",
  SalesmanName: "业务员",
  Remark_Leaf: "内门备注",
  Remark_Money: "价格说明",
  AttatchUrl: "附图"
}

export const getAttrKey = (attrChar) => {
  return Object.entries(orderAttrsMap2).find(
    ([a, b]) => b == attrChar
  )?.[0] || ''
}

export const computeCols = [
  "CountAttrs",
  "DoorLeafSize",
  "DoorPocketSize",
  "DoorwaySize",
  "LeafCount",
  "LineCount",
  "PieceCount",
  "PocketCount",
  "Field4",
  "Field5",
  "Field6",
  "Field13",
  "Square",
  "OrderMoney",
];
/**
 * @constant 结算属性
 */
export const settlementCols = [
  'Count',
  'UnitPrice',
  'Square',
  'PayMethod',
  'LockAmount',
  'LockCoreAmount',
  'LaceAmount',
  'WallAmount',
  'GlassAmount',
  'PackageAmount',
  'OtherAmount',
  'HandleAmount',
  'DoorHeaderAmount',
  'Discount',
  'SettlementAmount',
  'TotalAmount',
]
// 'OrderId','OrderId2','CustomerName','Province','City','Area','CreateTime','OrderTime','AuditTime','OrderAudit','ProduceTime','Indate','DeliveryEffectTime','OutDate','DeliveryTime','Status','ProductName','PartnerBrand',
export const mainOrderCols = [
  "SubCustomerName",
  "Field13",
  "ProcessName",
  "Field4",
  "Field5",
  "Field6",
  "WallThickness",
  "Field3",
  "Field8",
  "LaceName",
  "DoorStyle",
  "CountLeft",
  "CountRight",
  "MainExStyle",
  "MainInStyle",
  "SecExStyle",
  "SecInStyle",
  "ChildExStyle",
  "ChildInStyle",
  "SideExStyle",
  "SideInStyle",
  "FacadeExGlass",
  "FacadeGlass",
  "FacadeInGlass",
  "Field2",
  "OutdoorColor",
  "IndoorColor",
  "FrameColor",
  "FacadeMaterial",
  "ExFacadeMaterial",
  "InFacadeMaterial",
  "FrameMaterial",
  "LockName",
  "Field9",
  "Field12",
  "Field11",
  "ExGlassAirWin",
  "InGlassAirWin",
  "LowerLevelMaterial",
  "LowerLevelType",
  "LowerLevelHeight",
  "DoorHeader",
  "DoorPost",
  "DoorHeaderInstallPos",
  "PinName",
  "HingeName",
  "attrName58",
  "HingeNum",
  "Count",
  "UnitPrice",
  "Square",
  "PayMethod",
  "LockAmount",
  "LockCoreAmount",
  "LaceAmount",
  "WallAmount",
  "GlassAmount",
  "PackageAmount",
  "OtherAmount",
  "HandleAmount",
  "DoorHeaderAmount",
  "Discount",
  "SettlementAmount",
  "TotalAmount",
  "Remark",
  "OrderTaker",
  "Salesman",
  "InDoorRemark",
  "PriceDesc",
  "Picture",
];

export const mainAttrNames = [
  // '订单编号',
  // '工单编号',
  // '客户',
  // '省份',
  // '城市',
  // '县/区',
  // '创建日期',
  // '定货日期',
  // '技术审核',
  // '订单审核',
  // '生产下单',
  // '入库日期',
  // '发货单生效',
  // '出库日期',
  // '交货日期',
  // '状态',
  // '产品名称',
  // '代理品牌',
  // '子客户',
  // '工艺厚度',
  // '工艺名称',
  // '门体总高',
  // '门体总宽',
  // '主门高度',
  // '墙体厚度',
  // '开向',
  // '包边名称',
  // '花边名称',
  // '主外款式',
  // '主内款式',
  // '副外款式',
  // '副内款式',
  // '子外款式',
  // '子内款式',
  // '边外款式',
  // '边内款式',
  // '门面外玻',
  // '门面内玻',
  // '室外颜色',
  // '室内颜色',
  // '门框颜色',
  // '外门面材料',
  // '内门面材料',
  // '门框材料',
  // '锁具名称',
  // '拉手名称',
  // '气窗款式',
  // '气窗工艺',
  // '气窗外玻',
  // '气窗内玻',
  // '下档材料',
  // '下档类型',
  // '下档高度',
  // '门头',
  // '门柱',
  // '门头安装位置',
  // '插销名称',
  // '铰链名称',
  // '铰链个数',
  // '门头备注',
  // '数量',
  // '单价',
  // '平方',
  // '结算方式',
  // '锁具金额',
  // '锁芯金额',
  // '花边金额',
  // '墙体金额',
  // '玻璃金额',
  // '包装金额',
  // '其他金额',
  // '拉手金额',
  // '门头金额',
  // '折扣',
  // '结算金额',
  // '总金额',
  // '备注',
  // '接单员',
  // '业务员',
  // '内门备注',
  "子客户名称", "工艺厚度", "工艺名称", "门总高", "门总宽", "门高", "墙体厚度", "开向", "包边名称", "花边名称", "下单数量", "数量-左", "数量-右", "门面款式", "主外款式", "主内款式", "副外款式", "副内款式", "子外款式", "子内款式", "边外款式", "边内款式", "玻璃", "门面外玻", "门面内玻", "气窗外玻", "气窗内玻", "气窗款式", "气窗工艺", "颜色", "室外颜色", "室内颜色", "门框颜色", "门框材料", "门面材料", "外门面材料", "内门面材料", "锁具名称", "拉手名称", "下档材料", "下档类型", "下档高度", "门头", "门柱", "门头安装位置", "门头备注", "插销名称", "铰链名称", "铰链个数", "单价", "平方", "结算方式", "锁具金额", "锁芯金额", "花边金额", "墙体金额", "玻璃金额", "包装金额", "其他金额", "拉手金额", "门头金额", "折扣", "结算金额", "总金额", "备注", "接单员", "业务员", "内门备注", "价格说明", "附图"
]

export const selectKeys = ["Field1", "Field2", "Field3"];

/**
 * 需要添加附图的选项
 */
export const attachedPictureCols = ["拉手如图", "外门款式如图", "颜色如图", "花枝如图", "门头门柱如图", "气窗如图", "精雕如图", "下封板如图"];

export const doorShapeMap = {
  0: "矩形门",
  1: "拱形门",
  2: "圆形门",
  3: "格子门",
};
export const doorColorMap = {
  0: "银色",
  1: "棕色",
  2: "黑色",
  3: "粉色",
};
export const doorOpenAtMap = {
  0: "内右",
  1: "内左",
  2: "外右",
  3: "外左",
};

/**
 * @description 属性管理-录入类型-InputType
 */
export const inputTypeMap = {
  0: "列表",
  1: "手动",
  2: "图片",
};
/**
 * @description 属性管理-录入类型-InputType2
 */
export const inputModeMap = {
  0: {
    label: "文本",
    value: "text"
  },
  1: {
    label: "长文本",
    value: 'textarea'
  },
  2: {
    label: "数字",
    value: 'number'
  },
  3: {
    label: "不允许输入",
    value: 'none'
  },
};

/**
 * @description 属性管理-列固定
 */
export const fixMap = {
  0: {
    label: "不固定",
    value: false
  },
  1: {
    label: "左",
    value: 'left'
  },
  2: {
    label: "右",
    value: 'right'
  },
};

/**
 * @description 属性管理-计算类型
 */
export const computeTypeMap = {
  manual: "手动输入",
  formula: "公式计算",
};

/**
 * @description 属性管理-计算类型符号
 */
export const computeOperatorMap = {
  plus: "加",
  minus: "减",
  multiply: "乘",
  divide: "除",
};

export const opeartorSymbolMap = {
  plus: "+",
  minus: "-",
  multiply: "×",
  divide: "÷",
};

/**
 * @description 图片类型
 * 
 */
export const pictureType = {
  1: '品牌商标',
  2: '类型图片',
  3: '用户营业执照'
}